﻿using System;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace MapEditor
{
    public class Tile
    {
        Texture2D texture;
        Vector2 position;
        string assetName;

        public string AssetName
        {
            get
            {
                return assetName;
            }
            set
            {
                assetName = value;
            }
        }

        public Vector2 Position
        {
            get
            {
                return position;
            }
            set
            {
                position = value;
            }
        }

        public Tile()
        {
        }
        
        public Tile(string assetName, Vector2 position)
        {
            this.assetName = assetName;
            this.position = position;
        }

        public void LoadContent(ContentManager Content)
        {
            texture = Content.Load<Texture2D>(assetName);
        }

        public void draw(SpriteBatch spritebatch)
        {
            spritebatch.Draw(texture, new Vector2(position.X * texture.Width, position.Y * texture.Height), Color.White);
        }
    }
}
